package cn.pw.test.com.news.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.widget.FrameLayout;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.aries.ui.view.title.TitleBarView;
import com.flyco.tablayout.SegmentTabLayout;

import java.util.ArrayList;
import java.util.List;

import cn.pw.test.com.news.R;
import cn.pw.test.com.news.fragment.ArticleFragment;
import cn.pw.test.com.news.fragment.CalendarFragment;
import tech.com.commoncore.base.BaseTitleActivity;
import tech.com.commoncore.manager.TabLayoutManager;
/**
 * @deprecated
 */
//@Route(path = PathManage.NEWS_SHELF)
public class NewsShelfActivity extends BaseTitleActivity {

    private static final String[] titles = {"财经事件", "时事时讯"};

    private SegmentTabLayout segmentTabLayout;
    private ViewPager viewPager;

    @Override
    public void setTitleBar(TitleBarView titleBar) {
        titleBar
        .setBgDrawable(null);
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_news_shelf;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        segmentTabLayout = mContentView.findViewById(R.id.segment_tab_layout);
        viewPager = mContentView.findViewById(R.id.view_page);

        List<Fragment> fragments = new ArrayList<>();
        fragments.add(ArticleFragment.newInstance("4",false));
        fragments.add(CalendarFragment.newInstance());

        TabLayoutManager.getInstance().setSegmentTabData(this, segmentTabLayout, viewPager, titles, fragments);
    }
}
